package com.hs.wa.controller;


import com.hs.wa.service.RuleEmployeeService;

import com.springnew.model.Ruleemployee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

public class RuleEmployeeController {

	@Autowired
	private RuleEmployeeService ruleEmployeeService;

	@PostMapping("/getRuleEmployeeAxios")
	@ResponseBody  /* 解决 Unknown return value type: java.lang.Boolean*/
	public List<Ruleemployee> getRuleConfigAxios() {
		boolean flag = false;
		List<Ruleemployee> ruleconfigs;
		ruleconfigs = ruleEmployeeService.selectRuleEmployee();

		return ruleconfigs;
	}

	@PostMapping("/addRuleEmployeeAxios")
	@ResponseBody  /* 解决 Unknown return value type: java.lang.Boolean*/
	public ResponseEntity addRuleConfigAxios(Ruleemployee ruleEmployee) {
		boolean flag = ruleEmployeeService.updateRuleEmployee(ruleEmployee);

		if (flag) {
			return ResponseEntity.ok().build();
		}
		return ResponseEntity.badRequest().build();
	}


}
